import sys
from apps import create_app
from flask import render_template

env = None
if len(sys.argv) <= 1:
    env = "dev"
else:
    env = sys.argv[1]

app = create_app(env)

@app.route("/", methods=["GET"])
def index():
    return render_template("magicbook/index.html")

# 导入蓝图
from apps.core import core_blue
# 注册蓝图
app.register_blueprint(core_blue)

from apps.oparator import operator_blue
app.register_blueprint(operator_blue)

if __name__ == '__main__':
    print(app.url_map)
    app.run()
